<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <link rel="stylesheet" href="./libs/layui/css/layui.css">
</head>
<body>
  <div class="layui-container">
    <div class="layui-row">
      <div class="layui-col-sm6">1</div>
      <div class="layui-col-sm6">2</div>
      <div class="layui-col-sm6">3</div>
      <div class="layui-col-sm6">4</div>
    </div>
    <button class="layui-btn layui-btn-danger">按钮</button>
    <div id="rate"></div>

    <iframe src="http://www.baidu.com" frameborder="0"></iframe>
  </div>
  <script src="./libs/layui/layui.js"></script>
  <script>
    layui.use(['rate', 'jquery'], function(){
      var rate = layui.rate;
      var $ = layui.jquery;
      var rateins =  rate.render({
        elem: '#rate',  //绑定元素
        length: 10,
        value: 8,
        choose: function(value){
          if(value === 10) {
            alert('感谢亲')
          }
        }
      })
    /*   $(function(){
        alert(1)
      }) */
    })
  </script>
</body>
</html>